package com.twu.solo;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintStream;

/**
 * Created with IntelliJ IDEA.
 * User: thoughtworker
 * Date: 10/13/13
 * Time: 2:37 PM
 * To change this template use File | Settings | File Templates.
 */
public class AllowUserToSearchForPlayerByNameCommand implements Command {
    private PrintStream printStream;
    private BufferedReader reader;
    private League league;

    public AllowUserToSearchForPlayerByNameCommand(PrintStream printStream, BufferedReader reader, League league) {
        this.printStream = printStream;
        this.reader = reader;
        this.league = league;
    }

    @Override
    public void execute() throws IOException {
        printStream.println("Enter Player Name");
        String name = reader.readLine();
        league.printPlayerInfo(name);
    }

}
